<%--
  Created by IntelliJ IDEA.
  User: xin
  Date: 2024/9/20
  Time: 上午8:43
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" import=" java.text.*,java.util.*" %>
<html>
<head>
    <title>处理留言</title>
    <meta charset="UTF-8">
</head>
<body bgcolor="#abcdef">
<%! Vector<String> V = new Vector<String>();
int i=0;
%>
<%
    //获取系统时间
    String datetime=new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(Calendar.getInstance().getTime());
%>
<%
    //获取留言内容
    request.setCharacterEncoding("UTF-8");
    String name=request.getParameter("name");
    String title=request.getParameter("title");
    String message=request.getParameter("message");
%>
<%
    if (name==null||"".equals(name.trim())){
        name="网友"+(int)(Math.random()*10000+10000);
    }
    if (title==null||"".equals(title.trim())){
        title="无";
    }if (message==null||"".equals(message.trim())){
        message="无";
}
%>
<%
    i++;
    String str="第"+"<span class=span0>"+i+"</span>;"+"楼"
            +".<span class=span1>留言人:</span>"+name
            +".<span class=span2>标题:</span>"+title
            +".<span class=span3>内容:</span>"+message
            +".<span class=span4>时间:</span>"+datetime+"<hr>";
    V.add(str);
    application.setAttribute("messages",V);//将v设置为全局变量
%>
留言成功
<a href="inputMessage.jsp">返回留言板</a>
</body>
</html>
